package com.gof.example.singleton.iodhmore;

/**
 * Created with IntelliJ IDEA.
 * Created by zhiyuan on 2018/5/1 21:37.
 * haiming.fei@tongdun.cn
 */
public class App {

    public static void main(String[] args) {
        TestThread test1 = new TestThread();
        TestThread test2 = new TestThread();
        Thread t1 = new Thread(test1);
        Thread t2 = new Thread(test2);
        t1.start();
        t2.start();

        System.out.println(LoadBalancer.getInstance());
        System.out.println(LoadBalancer.getInstance());
        System.out.println(LoadBalancer.getInstance());
        System.out.println(LoadBalancer.getInstance());
        System.out.println(LoadBalancer.getInstance());


        System.out.println(LoadBalancer.getInstance());
        System.out.println(LoadBalancer.getInstance());
        System.out.println(LoadBalancer.getInstance());

        //打印
        for (LoadBalancer loadBalancer : LoadBalancer.getList()) {
            System.out.println(loadBalancer);
        }
    }
}
